package com.logisticsmanagement.admin_pro;

import com.logisticsmanagement.R;

import android.os.Bundle;
import android.app.Activity;
import android.app.Fragment;
import android.app.FragmentManager;
import android.app.FragmentTransaction;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.TextView;

/**
 * 省公司管理员职能类
 * @author 陈朝辉
 * @createTime 2015年3月17日 上午11:11:23
 * @version 1.0
 */
public class Admin_provinceActivity extends Activity implements OnClickListener{

	private FragmentManager fragmentManager;
	Fragment rolefragment;
	TextView roleManagement;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_admin_province);		
		roleManagement = (TextView)findViewById(R.id.tvRoleManagementAdminPro);
		roleManagement.setOnClickListener(this);
		fragmentManager = getFragmentManager();
		//设置默认fragment
		
		Intent intent = getIntent();
		
		//开启事务
		FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
		rolefragment = new RoleManagement();
		//提交事务
		fragmentTransaction.replace(R.id.fl_roleManagement, rolefragment).commit();
	};
	@Override
	public void onClick(View view) {
		// TODO Auto-generated method stub
		fragmentManager = getFragmentManager();
		//开启事务
		FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
		//跳转角色管理fragment
		if(rolefragment==null){
			rolefragment = new RoleManagement();
		}
		//提交事务
		fragmentTransaction.replace(R.id.fl_roleManagement, rolefragment).commit();
	}
}
